/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controller.CoreServlet;

import Model.BeanUltility.ResultsetMapper;
import Model.DataUltility.DatabaseConnector;
import Model.ObjectBean.ViewBean.PersonalInfo_FrDatabase;
import Model.ObjectBean.ViewBean.UserAccount_FrDatabase;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author Tran Nguyen Anh Tu
 */
public class LoggedServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("UTF-8");
        resp.setCharacterEncoding("UTF-8");
        resp.setContentType("text/html; charset=UTF-8");
        
        String target="WEB-INF/MainJSP/";
           
        String request = req.getParameter("request");
        if(request.equals("changepass"))
        {
            target+="changepass.jsp";
        }
        else if(request.equals("changeinfo"))
        {
            target+="changeuserinfo.jsp";
        }
        
        RequestDispatcher dispatcher = req.getRequestDispatcher(target);
        dispatcher.forward(req, resp);
    }

    
}
